package rad.framework.mda.generator.template.main.webapp.webinf;

import java.util.*;
import org.eclipse.uml2.uml.*;
import rad.framework.mda.generator.util.*;

public class Web
{
  protected static String nl;
  public static synchronized Web create(String lineSeparator)
  {
    nl = lineSeparator;
    Web result = new Web();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + NL + "<web-app version=\"2.4\" " + NL + "\txmlns=\"http://java.sun.com/xml/ns/j2ee\"" + NL + "\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" + NL + "\txsi:schemaLocation=\"http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd\">" + NL + "" + NL + "\t<!--" + NL + "\t\thttp://wiki.jboss.org/wiki/Wiki.jsp?page=JbossTimeoutSettingForSeam" + NL + "\t\tHttpSession timeout should be the shortest, then seam conversation timeout, then SFSB timeout" + NL + "\t-->" + NL + "\t<session-config>" + NL + "\t\t<session-timeout>20</session-timeout>" + NL + "\t</session-config>" + NL + "" + NL + "\t<!-- Seam -->" + NL + "\t<listener>" + NL + "\t\t<listener-class>org.jboss.seam.servlet.SeamListener</listener-class>" + NL + "\t</listener>" + NL + "" + NL + "\t<servlet>" + NL + "\t\t<servlet-name>Seam Resource Servlet</servlet-name>" + NL + "\t\t<servlet-class>org.jboss.seam.servlet.ResourceServlet</servlet-class>" + NL + "\t</servlet>" + NL + "" + NL + "\t<servlet-mapping>" + NL + "\t\t<servlet-name>Seam Resource Servlet</servlet-name>" + NL + "\t\t<url-pattern>/seam/resource/*</url-pattern>" + NL + "\t</servlet-mapping>" + NL + "" + NL + "\t<filter>" + NL + "\t\t<filter-name>Seam Filter</filter-name>" + NL + "\t\t<filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>" + NL + "\t</filter>" + NL + "\t" + NL + "\t<filter-mapping>" + NL + "\t\t<filter-name>Seam Filter</filter-name>" + NL + "\t\t<url-pattern>/*</url-pattern>" + NL + "\t</filter-mapping>" + NL + "\t\t" + NL + "\t<context-param>" + NL + "\t\t<param-name>javax.faces.CONFIG_FILES</param-name>" + NL + "\t\t<param-value>/WEB-INF/navigation.xml</param-value>" + NL + "\t</context-param>" + NL + "\t<context-param>" + NL + "\t\t<param-name>facelets.DEVELOPMENT</param-name>" + NL + "\t\t<param-value>false</param-value>" + NL + "\t</context-param>" + NL + "\t<context-param>" + NL + "\t\t<param-name>facelets.SKIP_COMMENTS</param-name>" + NL + "\t\t<param-value>true</param-value>" + NL + "\t</context-param>" + NL + "\t<context-param>" + NL + "\t\t<param-name>facelets.VIEW_MAPPINGS</param-name>" + NL + "\t\t<param-value>*.xhtml</param-value>" + NL + "\t</context-param>" + NL + "\t<context-param>" + NL + "\t\t<param-name>javax.faces.DEFAULT_SUFFIX</param-name>" + NL + "\t\t<param-value>.xhtml</param-value>" + NL + "\t</context-param>" + NL + "\t<context-param>" + NL + "\t\t<param-name>javax.faces.STATE_SAVING_METHOD</param-name>" + NL + "\t\t<param-value>server</param-value>" + NL + "\t</context-param>" + NL + "\t<context-param>" + NL + "\t\t<param-name>facelets.LIBRARIES</param-name>" + NL + "\t\t<param-value>/WEB-INF/jsf/tags/rad-framework.taglib.xml;/WEB-INF/pdf/tags/rad-framework.taglib.xml;/WEB-INF/excel/tags/rad-framework.taglib.xml</param-value>" + NL + "\t</context-param>" + NL + "\t<context-param>" + NL + "\t\t<param-name>facelets.RESOURCE_RESOLVER</param-name>" + NL + "\t\t<param-value>rad.framework.jsf.ClasspathResourceResolver</param-value>" + NL + "\t</context-param>" + NL + "\t" + NL + "\t<!-- uncomment for production" + NL + "\t<context-param>" + NL + "\t\t<param-name>facelets.REFRESH_PERIOD</param-name>" + NL + "\t\t<param-value>-1</param-value>" + NL + "\t</context-param>" + NL + "\t-->" + NL + "\t<context-param>" + NL + "\t\t<param-name>facelets.BUFFER_SIZE</param-name>" + NL + "\t\t<param-value>500000</param-value>" + NL + "\t</context-param>" + NL + "\t<context-param>" + NL + "\t\t<param-name>com.sun.faces.responseBufferSize</param-name>" + NL + "\t\t<param-value>500000</param-value>" + NL + "\t</context-param>" + NL + "\t<context-param>" + NL + "\t\t<param-name>com.sun.faces.serializationProvider</param-name>" + NL + "\t\t<param-value>org.jboss.web.jsf.integration.serialization.JBossSerializationProvider</param-value>" + NL + "\t</context-param>" + NL + "\t<context-param>" + NL + "\t\t<param-name>com.sun.faces.numberOfViewsInSession</param-name>" + NL + "\t\t<param-value>50</param-value>" + NL + "\t</context-param>" + NL + "\t<context-param>" + NL + "\t\t<param-name>com.sun.faces.numberOfLogicalViews</param-name>" + NL + "\t\t<param-value>50</param-value>" + NL + "\t</context-param>" + NL + "" + NL + "\t<servlet>" + NL + "\t\t<servlet-name>FacesServlet</servlet-name>" + NL + "\t\t<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>" + NL + "\t\t<load-on-startup>1</load-on-startup>" + NL + "\t</servlet>" + NL + "\t<servlet-mapping>" + NL + "\t\t<servlet-name>FacesServlet</servlet-name>" + NL + "\t\t<url-pattern>*.seam</url-pattern>" + NL + "\t</servlet-mapping>" + NL + "\t" + NL + "\t<!-- Ajax4jsf/Richfaces setup -->" + NL + "\t<context-param>" + NL + "\t\t<param-name>org.richfaces.LoadStyleStrategy</param-name>" + NL + "\t\t<param-value>ALL</param-value>" + NL + "\t</context-param>\t" + NL + "\t<context-param>" + NL + "\t\t<param-name>org.richfaces.LoadScriptStrategy</param-name>" + NL + "\t\t<param-value>ALL</param-value>" + NL + "\t</context-param>" + NL + "\t<context-param>" + NL + "\t\t<param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>" + NL + "\t\t<param-value>false</param-value>" + NL + "\t</context-param>" + NL + "\t<context-param>" + NL + "\t        <param-name>com.sun.faces.enableRestoreView11Compatibility</param-name>" + NL + "\t        <param-value>true</param-value>" + NL + "\t</context-param>" + NL + "" + NL + "\t<!-- Seam PDF -->" + NL + "\t<servlet>" + NL + "\t\t<servlet-name>Document Store Servlet</servlet-name>" + NL + "\t\t<servlet-class>org.jboss.seam.document.DocumentStoreServlet</servlet-class>" + NL + "\t</servlet>" + NL + "" + NL + "\t<servlet-mapping>" + NL + "\t\t<servlet-name>Document Store Servlet</servlet-name>" + NL + "\t\t<url-pattern>*.pdf</url-pattern>" + NL + "\t</servlet-mapping>" + NL + "\t<servlet-mapping>" + NL + "\t\t<servlet-name>Document Store Servlet</servlet-name>" + NL + "\t\t<url-pattern>*.xls</url-pattern>" + NL + "\t</servlet-mapping>" + NL + "\t<servlet-mapping>" + NL + "\t\t<servlet-name>Document Store Servlet</servlet-name>" + NL + "\t\t<url-pattern>*.cvs</url-pattern>" + NL + "\t</servlet-mapping>" + NL + "\t" + NL + "\t<!-- Export Servlet -->" + NL + "\t<servlet>" + NL + "\t\t<servlet-name>ExportServlet</servlet-name>" + NL + "\t\t<servlet-class>rad.framework.web.ExportServlet</servlet-class>" + NL + "\t</servlet> " + NL + "\t" + NL + "\t<servlet-mapping>" + NL + "\t\t<servlet-name>ExportServlet</servlet-name>" + NL + "\t\t<url-pattern>/export/export.xml</url-pattern>" + NL + "\t</servlet-mapping>" + NL + "\t" + NL + "\t<!-- Validation Util Servlet " + NL + "\t<servlet>" + NL + "\t\t<servlet-name>ValidationServlet</servlet-name>" + NL + "\t\t<servlet-class>rad.framework.web.ValidationServlet</servlet-class>" + NL + "\t\t<init-param>" + NL + "\t\t\t<param-name>persistenceUnitJndiName</param-name>" + NL + "\t\t\t<param-value>java:/catalog</param-value>" + NL + "\t\t</init-param>" + NL + "\t</servlet>" + NL + "\t" + NL + "\t<servlet-mapping>" + NL + "\t\t<servlet-name>ValidationServlet</servlet-name>" + NL + "\t\t<url-pattern>/validate</url-pattern>" + NL + "\t</servlet-mapping>" + NL + "\t-->" + NL + "\t" + NL + "</web-app>";

  public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
    

    Model uml2Model = (Model) argument;
    stringBuffer.append(TEXT_1);
    return stringBuffer.toString();
  }
}
